<template>
    <div>
        <el-dialog title="日志详情" :visible.sync="dialogViewVisible" width="60%" :show-close="false"
            :close-on-click-modal="false" style="height: 100%;margin-top: 6%;" custom-class="customclassdialog">
            <el-form :model="form" style="max-height: 30%;overflow-y: auto;"
                :style="'max-height:' + windowHeight / 2 + 'px;'">
                <el-row>
                    <el-col style="padding: 0 0 6px 0;font-size: 18px;">
                        基础信息
                    </el-col>
                    <el-col>
                        <el-row style="border-bottom: 1px solid #e8e8e8;margin-bottom: 10px;">
                            <el-col :span="8">
                                <el-form-item label="设备编码:" :label-width="formLabelWidth">
                                    {{ form.equ_no }}
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="所属电站:" :label-width="formLabelWidth">
                                    {{ form.base_station && form.base_station.name }}
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="所属区域:" :label-width="formLabelWidth">
                                    {{ form.region && form.region.name }}
                                </el-form-item>
                            </el-col>
                            <!-- <el-col :span="6" v-if="form.equipmentstate">
                        <el-form-item label="设备状态:" :label-width="formLabelWidth">
                            {{ equipmentstateoptions[form.equipmentstate].label }}
                        </el-form-item>
                    </el-col> -->
                            <!-- <el-col :span="6">
                        <el-form-item label="设备电压:" :label-width="formLabelWidth">
                            {{ form.districtname }}
                        </el-form-item>
                    </el-col> -->
                            <!-- <el-col :span="6">
                        <el-form-item label="工作电压:" :label-width="formLabelWidth">
                            {{ form.districtname }}
                        </el-form-item>
                    </el-col> -->
                            <!-- <el-col :span="6">
                        <el-form-item label="充电状态:" :label-width="formLabelWidth">
                            {{ form.districtname }}
                        </el-form-item>
                    </el-col> -->
                        </el-row>
                    </el-col>
                    <el-col style="padding: 0 0 6px 0;font-size: 18px;">
                        触发信息
                    </el-col>

                    <el-col>
                        <el-row style="border-bottom: 1px solid #e8e8e8;">
                            <el-col :span="12">
                                <el-form-item label="触发事件:" :label-width="formLabelWidth">
                                    {{ form.C001_name }}
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="触发时间:" :label-width="formLabelWidth">
                                    {{ form.created_at }}
                                </el-form-item>
                            </el-col>
                            <!-- <el-col :span="16">
                        <el-form-item label="当前位置:" :label-width="formLabelWidth">
                            {{ form.districtaddress }}
                        </el-form-item>
                    </el-col> -->
                        </el-row>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="执行结果:" :label-width="formLabelWidth">
                            {{ form.status == 1 ? '完成' : '未完成' }}
                        </el-form-item>
                    </el-col>

                </el-row>
            </el-form>

            <div slot="footer" class="dialog-footer">
                <el-button @click="cancel">关 闭</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
export default {
    name: 'WorkspaceJsonJournalOperation',
    props: {
        operationtype: {
            type: String
        },
        optionVal: {
            type: Object
        },
        dialogViewVisible: {
            type: Boolean
        }
    },
    watch: {
        optionVal: {
            handler(ne, ol) {
                this.form = ne
            },
            deep: true,
            immediate: true
        }
    },
    data() {
        return {
            formLabelWidth: '100px',
            form: {},
            srcList: [],
            equipmentstateoptions: [
                {
                    label: '正常',
                    value: 0
                },
                {
                    label: '停止',
                    value: 1
                },
                {
                    label: '报警',
                    value: 2
                },
                {
                    label: '离线',
                    value: 3
                },
                {
                    label: '检修',
                    value: 4
                },
            ],
            tags: [
                { name: 'CN001', type: '' },
                { name: 'CN002', type: '' },
                { name: 'CN003', type: '' },
                { name: 'CN004', type: '' },
                { name: 'CN005', type: '' },
                { name: 'CN006', type: '' },
            ],
            windowHeight: 0,
            innerVisible: false,
            videoInnerVisible: false
        };
    },
    mounted() {
        this.windowHeight = document.body.clientHeight;
    },

    methods: {
        advanceHeld() {
            console.log('前进', this.form);
        },
        retreatHeld() {
            console.log('后退', this.form);
        },
        stopHeld() {
            console.log('停止', this.form);
        },
        backHeld() {
            console.log('返回', this.form);
        },
        parameterHeld() {
            this.innerVisible = true
            console.log('参数设置', this.form);
        },
        videoHeld() {
            this.videoInnerVisible = true
            console.log('视频监控', this.form);
        },
        journalHeld() {
            console.log('日志', this.form);
        },
        cancel() {
            this.$emit('OperationHeld', false);
        },
        innerVisibleHeld() {
            this.innerVisible = false
            console.log('参数设置');
        }
    },
};
</script>

<style lang="scss" scoped>
::v-deep .customclassdialog {
    border-radius: 10px !important;
}
</style>